{extend name="base" /}
{block name="css"}
<style>
#preview img{max-width: 600px;max-height:150px;}
</style>
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
{/block}
{block name="js"}
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
<script src="__ADMIN__/ads/admgrs.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<form id="adsForm">
<input type="hidden" class='ipt' name="" value="{$position['positionId']}" id="adPositionId" autocomplete="off">
<input type="hidden" class='ipt' name="" value="{$position['positionType']}" id="positionType" autocomplete="off">
<input type="hidden" class='ipt' name="" value="{$position['positionId']}" id="positionId" autocomplete="off">
<table class='wst-form wst-box-top'>
  <tr>
      <th width='150'>位置类型<font color='red'>*</font>：</th>
          <td>
            <select name="positionType" maxLength='20' style="background-color:#eee;" disabled="disabled">
              <option value=''>请选择</option>
              {volist name=":WSTDatas('ADS_TYPE')" id='vo'}
              <option {if $position['positionType'] == $vo['dataVal']}selected{/if} value="{$vo['dataVal']}">{$vo['dataName']}</option>
              {/volist}
            </select>
          </td>
       </tr>
       <tr>
          <th>广告位置<font color='red'>*</font>：</th>
          <td>
            <input type="text" maxLength="200" value='{$position['positionName']}' readonly="readonly"/>
          </td>
       </tr>
       <tr>
          <th>广告标题<font color='red'>*</font>：</th>
          <td><input type='text' id='adName' name="adName" value='{$data['adName']}' class='ipt' maxLength='20'/></td>
       </tr>
       <tr>
          <th>广告副标题：</th>
          <td><input type='text' id='subTitle' name="subTitle" value='{$data['subTitle']}' class='ipt' maxLength='20'/></td>
       </tr>
       <tr>
          <th>广告图片<font color='red'>*</font>：</th>
          <td><div id='adFilePicker'>上传广告图</div><span id='uploadMsg'></span>
              <div>
                图片大小:<span id="img_size">300x300</span>(px)，格式为 gif, jpg, jpeg, png
              </div>
          </td>

       </tr>
       <tr>
          <th>预览图<font color='red'>  </font>：</th>
          <td>
            <div id="preview" style="min-height:30px;">
              {if ($data['adFile']!='')}
              <img src="__RESOURCE_PATH__/{$data['adFile']}">
              {/if}
            </div>
            <input type="hidden" name="adFile" id="adFile" class="ipt" value="{$data['adFile']}" />
          </td>
       </tr>
       <tr>
          <th>广告网址<font color='red'>  </font>：</th>
          <td>
            <input type="text" id="adURL" class="ipt" maxLength="200" value='{$data['adURL']}' />
          </td>
       </tr>
       <tr>
          <th >广告开始时间<font color='red'>*</font>：</th>
          <td>
            <input type="text" style="margin:0px;vertical-align:baseline;" id="adStartDate" name="adStartDate" class="laydate-icon ipt" maxLength="20" value='{$data['adStartDate']}'  />
          </td>
       </tr>
       <tr>
          <th>广告结束时间<font color='red'>*</font>：</th>
          <td>
            <input type="text" style="margin:0px;vertical-align:baseline;" id="adEndDate" name="adEndDate" class="laydate-icon ipt" maxLength="20" value='{$data['adEndDate']}' />
          </td>
       </tr>
       <tr>
          <th>广告排序号：</th>
          <td>
            <input type="text" id="adSort" class="ipt" maxLength="20"  value='{$data['adSort']}' />
          </td>
       </tr>
  
  <tr>
     <td colspan='2' align='center' class='wst-bottombar'>
       <input type="hidden" name="id" id="adId" class="ipt" value="{$data['adId']+0}" />
       <button type="button" class="btn btn-primary btn-mright" onclick="javascript:save(1)"><i class="fa fa-check"></i>提交</button>
       {if $data['adId']==0}
       <button type="button" class="btn btn-primary btn-mright" onclick="javascript:continueAdd(1)"><i class="fa fa-check"></i>继续新增</button> 
       {/if} 
        <button type="button" class="btn" onclick="javascript:location.href='{:Url(\'admin/ads/index\',\'p=\'.$p)}'"><i class="fa fa-angle-double-left"></i>返回</button>
     </td>
  </tr>
</table>
</form>
<script>
$(function(){
editInit({$p});
});

</script>
{/block}

